#define _CRT_SECURE_NO_WARNINGS 1
#include"Sort.h"

void PrintArray(int* a, int n)
{
	for (int i = 0; i < n; i++)
	{
		printf("%d ", a[i]);
	}
	printf("\n");
}

void TestBubble()
{
	int a[] = { 1,3,7,6,9,4,5,8,2,11 };
	BubbleSort(a, sizeof(a) / sizeof(a[0]));
	PrintArray(a, sizeof(a) / sizeof(a[0]));
}

void TestSelect()
{
	int a[] = { 1,3,7,6,9,4,5,8,2,11 };
	SelectSort(a, sizeof(a) / sizeof(a[0]));
	PrintArray(a, sizeof(a) / sizeof(a[0]));
}

void TestInsert()
{
	int a[] = { 1,3,7,6,9,4,5,8,2,11 };
	InsertSort(a, sizeof(a) / sizeof(a[0]));
	PrintArray(a, sizeof(a) / sizeof(a[0]));
}

void TestQuckily()
{
	int a[] = { 1,3,7,6,9,4,5,8,2,11 };
	QuckilySort(a, 0, sizeof(a) / sizeof(a[0]) - 1);
	PrintArray(a, sizeof(a) / sizeof(a[0]));
}

void TestHeap()
{
	int a[] = { 1,3,7,6,9,4,5,8,2,11 };
	HeapSort(a, sizeof(a) / sizeof(a[0]));
	PrintArray(a, sizeof(a) / sizeof(a[0]));
}

void TestShell()
{
	int a[] = { 1,3,7,6,9,4,5,8,2,11 };
	ShellSort(a, sizeof(a) / sizeof(a[0]));
	PrintArray(a, sizeof(a) / sizeof(a[0]));
}

int main()
{
	//TestBubble();
	//TestSelect();
	//TestInsert();
	//TestShell();
	//TestHeap();
	TestQuckily();
	return 0;
}